package com.atguigu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author admin
 * @title: ApplicationContextConfig
 * @projectName cloud2021
 * @description: TODO
 * @date 2021/4/5 13:21
 */
@Configuration
public class ApplicationContextConfig {
    @Bean
    //使用自己写的负载均衡则注释该地方
//    @LoadBalanced //使用@LoadBalanced注解赋予RestTemplate负载均衡的能力
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
